<template>
	<view class="content">
		<cu-custom bgColor="bg-gradual-red" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">{{title}}</block>
		
		</cu-custom>
		<Loading class="loading" v-show="!isLoading" :isStatus='loadStatus'></Loading>
		<StatusBar></StatusBar>
		
		
	</view>
</template>

<script>
	export default {
		name: "notice",
		data() {
			return {
				title: "分析",
				page:null,
				isLoading: false, //是否加载完成显示
				loadStatus: 'load',
				url:'',
			}
		},
		onHide() {
			this.page.close();
			
		},
		onLoad(option) {
			this.url=option.url;
			this.create();
		},
		onBackPress() {
			
			this.page.close();
		},
		methods:{
			create(){
				let create=()=>{
					this.getInfo().then((e) => {
						this.page = plus.webview.open(this.url, "分析", {
							top: e.CustomBar + 'px',
							bottom: 0 + 'px'
						}, "auto", 200, () => {
							this.page.evalJS(
								`var style = document.createElement('style');style.innerHTML='header, .follow, .item-tab, .search-league, .icon-return, .sk-point, .sk-btips,.popup-newuser,#globalTabBar,#banner-3rd,.navigator ul li:nth-last-of-type(1),.app500-download ,.switch-box{ display: none!important;}'; document.getElementsByTagName('HEAD').item(0).appendChild(style)`
								);
							this.page.hide();
							setTimeout(()=>{
								this.show();
							},1500);
						});
					})
				}
				
				
				(this.page!=null)?this.show():create();
				
			},
			
			show(){
				this.page.show();
				this.isLoading=true;
			}
		}
		
	}
</script>
